<?php
/*
*	@程序初始化
*
*
*/
define('IN_SITE',true);
header("Cache-control: private");
header("Content-Type: text/html; charset=UTF-8");

//程序开始时间
$start_time = array_sum(explode(' ',microtime()));

//针对sqlite的转义
ini_set('magic_quotes_sybase','On');

//对用户传入的变量进行Addslash操作
/*if (!get_magic_quotes_gpc()) {
    function addslashes_deep($value) {
        $value = is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value);
        return $value;
    }
    $_POST      = array_map('addslashes_deep', $_POST);
    $_GET       = array_map('addslashes_deep', $_GET);
    $_COOKIE    = array_map('addslashes_deep', $_COOKIE);
    $_REQUEST   = array_map('addslashes_deep', $_REQUEST);
}*/

//网站根目录处理
define('FILE_ROOT',str_replace('include/common.inc.php', '', str_replace('\\', '/', __FILE__)));

include_once('config.inc.php');
include_once('db.inc.php');

include_once('fun.inc.php');
include_once('template.inc.php');

date_default_timezone_set('PRC');//设置时区


//是否开启程序调试模式
error_reporting(7);
if($_CONFIG['debug']) {
	error_reporting(0);
}


//session_start();





session_start();



//初始化数据库访问对象
$db = new db($_CONFIG['db']['dsn']);





//初始化本地时间
$localtime = time();
ob_start();
?>